import service from "@/utils/service";

// 查询某个汽修站二级维护申请
export const getSecondMaintainApplyApi = () => {
  return service({
    url: "/xiechetong/xctRepairSecondMaintainApply/get-status",
    method: "get",
  });
};
// 申请二级维护
export const applySecondMaintainApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairSecondMaintainApply/add",
    method: "put",
    data
  });
};

// 获取二级维护申请列表
export const getSecondMaintainApplyListApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairSecondMaintainApply/page",
    method: "post",
    data
  });
};
// 审核申请的二级维护
export const auditSecondMaintainApplyApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairSecondMaintainApply/audit",
    method: "post",
    data
  });
};

// 模糊查询所有客运企业下的车辆
export const getEnterpriseCardInfoByLicensePlateApi = (data:any) => {
  return service({
    url: "/xiechetong/xctSecondMaintainCompanyCar/get-car-plate",
    method: "get",
    params:data,
  });
};

// 查询客运企业车辆列表
export const getEnterpriseCarPageApi = (data: any) => {
  return service({
    url: "/xiechetong/xctSecondMaintainCompanyCar/page",
    method: "post",
    data
  });
};
// 新增客运企业车辆
export const addEnterpriseCarApi = (data: any) => {
  return service({
    url: "/xiechetong/xctSecondMaintainCompanyCar/add",
    method: "put",
    data
  });
};

// 编辑客运企业车辆
export const editEnterpriseCarApi = (data: any) => {
  return service({
    url: "/xiechetong/xctSecondMaintainCompanyCar/update",
    method: "post",
    data
  });
};
// 删除客运企业车辆
export const deleteEnterpriseCarApi = (data: any) => {
  return service({
    url: "/xiechetong/xctSecondMaintainCompanyCar/del/" + data,
    method: "delete",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};
// 获取客运企业车辆已经完善的信息-不同年份
export const getEnterpriseCardInfoApi = (data: any) => {
  return service({
    url: "/xiechetong/xctSecondMaintainCompanyCar/get-card-accident",
    method: "post",
    data
  });
};
// 完善客运企业车辆信息-不同年份
export const completeEnterpriseCarApi = (data: any) => {
  return service({
    url: "/xiechetong/xctSecondMaintainCompanyCar/edit-card-accident",
    method: "post",
    data
  });
};

// 归档客运企业资料-不同年份
export const archiveEnterpriseCarApi = (data: any) => {
  return service({
    url: "/xiechetong/xctSecondMaintainCompanyCar/car-pigeonhole",
    method: "get",
    params: data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    },
    responseType: "blob"
  });
};

// 查询客运企业
export const getEnterpriseListApi = (data: any) => {
  return service({
    url: "/xiechetong/xctSecondMaintainCompany/list",
    method: "post",
    data
  });
};
// 质量检验员
export const getQualityCheckerListApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairCompanyPersonnel/list",
    method: "post",
    data
  });
};

// 获取维修记录列表
export const getSecondMaintainRecordListApi = (data: any) => {
  return service({
    url: "/xiechetong/xctSecondMaintainRepairRecord/page",
    method: "post",
    data
  });
};
// 新增维修记录
export const addSecondMaintainRecordApi = (data: any) => {
  return service({
    url: "/xiechetong/xctSecondMaintainRepairRecord/add",
    method: "put",
    data
  });
};
// 编辑维修记录
export const editSecondMaintainRecordApi = (data: any) => {
  return service({
    url: "/xiechetong/xctSecondMaintainRepairRecord/update",
    method: "post",
    data
  });
};

// 获取维修记录详情
export const getSecondMatainRecordDetailApi = (params: any) => {
  return service({
    url: "/xiechetong/xctSecondMaintainRepairRecord/getById",
    method: "get",
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};

// 获取合同信息
export const getSecondContractInfoApi = (params: any) => {
  return service({
    url: "/xiechetong/xctSecondMaintainRepairRecordContract/get-by-record-id",
    method: "get",
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};

// 下载合同
export const downLoadSecondContractApi = (data: any) => {
  return service({
    url: "/xiechetong/xctSecondMaintainRepairRecord/download-contract",
    method: "post",
    data,
    responseType: "blob"
  });
};

// 上传合同
export const uploadSecondContractApi = (data: any) => {
  return service({
    url: "/xiechetong/xctSecondMaintainRepairRecord/upload-contract",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};

// 分配检测站
export const assignCheckStationApi = (data: any) => {
  return service({
    url: "/xiechetong/xctSecondMaintainRepairRecord/allot-inspection",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};
// 获取检测站列表
export const getCheckStationListApi = (data: any) => {
  return service({
    url: "/xiechetong/xctInspectionStationMain/list-not-login-min",
    method: "post",
    data
  });
};

// 上传报告
export const uploadSecondReportApi = (data: any) => {
  return service({
    url: "/xiechetong/xctSecondMaintainRepairRecord/upload-report",
    method: "post",
    data
  });
};

// 查询二级维护维护费用
export const getSecondMaintaionCostInfoApi = () => {
  return service({
    url: "/xiechetong/xctCostInfo/get-detail",
    method: "get",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};

// 查询二级维护费用充值记录
export const getSecondMaintainCostRecordPageApi = (data: any) => {
  return service({
    url: "/xiechetong/xctCheckCostRechargeRecord/page",
    method: "post",
    data
  });
};
// 支付二级维护费用
export const paySecondMatintainConstApi = (data: any) => {
  return service({
    url: "/xiechetong/pay/check-const-pay",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};
// 二级维护每条费用
export const getSecondMaintainEveryApi = (params: any) => {
  return service({
    url: "/xiechetong/sysDict/getByKey",
    method: "get",
    params,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};
